package chapterTwo.constructors;
/*
class Top {
	public Top(String s) {
		System.out.print("B");
	}
	public Top(){}
}

public class Bottom2 extends Top {
	public Bottom2(String s) {
		System.out.print("D");
	}

	public static void main(String[] args) {
		new Bottom2("C");
		System.out.println(" ");
	}
}*//*
public class Redwood extends Tree {
	   public static void main(String[] args) {
	     new Redwood().go();
	   }
	   void go() { 
	     go2(new Tree(), new Redwood()); 
	     go2((Redwood) new Tree(), new Redwood());
	   }
	   void go2(Tree t1, Redwood r1) {
	      Redwood r2 = (Redwood)t1;
	      Tree t2 = (Tree)r1;
	   }
	 }
	 class Tree { }*/
/*
class Alpha {
	  static String s = " ";
	  protected Alpha() { s += "alpha "; }
	}
	class SubAlpha extends Alpha {
		public static void main(String[] args) {
		    new SubSubAlpha();
		    System.out.println(s);
		  }
		
	  private SubAlpha() { s += "sub "; }
	}
	public class SubSubAlpha extends Alpha {
	  private SubSubAlpha() { s += "subsub "; }
	  
	}/*/


class A { }
class B extends A { }
public class ComingThru {
  static String s = "-";
  public static void main(String[] args) {
    A[] aa = new A[2];
    B[] ba = new B[2];
    sifter(aa);
    sifter(ba);
    sifter(7);
    System.out.println(s);
  }
  static void sifter(A[]... a2)    { s += "1"; }
  static void sifter(B[]... b1)    { s += "2"; }
  static void sifter(B[] b1)       { s += "3"; }
  static void sifter(Object o)     { s += "4"; }
}
